﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace GGH
{
    public partial class Room : Form
    {
        public Room()
        {
            InitializeComponent();
        }
        public string RoomName
        {
            get { return textBox1.Text; }
            set { textBox1.Text = value; }
        }
        public int Capacity
        {
            get { return int.Parse(textBox2.Text); }
            set { textBox2.Text = value.ToString(); }
        }
        public string Desc
        {
            get { return textBox3.Text; }
            set { textBox3.Text = value; }
        }
        private void textBox2_TextChanged(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text.Length > 0 && textBox2.Text.Length > 0 && textBox3.Text.Length > 0)
            {
                this.DialogResult = DialogResult.OK;    
            }
        }

        private void textBox2_KeyPress(object sender, KeyPressEventArgs e)
        {
            e.Handled = !char.IsDigit(e.KeyChar) && !char.IsControl(e.KeyChar);
        }
    }
}
